<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ page import="java.sql.*" %>
  <%  String locstr="",cname="",cidstr=cid;
      ResultSet rsq=con.getRs("select classid,classname from web_infoclass where classid="+cid);
	  try{
	   if(rsq.next()){
	   cname=rsq.getString("classname");
	   locstr="&gt"+cname+"";
	   
	   }
	   rsq.close();
	  }catch(Exception e){ }
	   rsq=con.getRs("select classid from web_infoclass where sid="+cid);
	  try{
	   while(rsq.next()){
	    cidstr=cidstr+","+rsq.getString("classid");
	   }
	    rsq.close();
	  }catch(Exception e){ }
	 
	 %>
     <table width="100%" border="0" cellpadding="0" cellspacing="0">
                 <tr>
                   <td height="50" style="background:url(images/lanbt.gif) no-repeat" ><table width="100%" border="0">
                     <tr>
                       <td width="30%" height="26" valign="bottom" class="redbt"><%=cname%></td>
                       <td width="70%" align="right" valign="bottom"  class="locationstr"><!--<a href="<%=basePath%>">首页 </a> <%=locstr %> --></td>
                     </tr>
                   </table></td>
                 </tr>
  </table>
  <div>&nbsp</div>
  <div align="center" >
     <table width="85%" border="0" align="center" cellpadding="8" style="background:url(images/map.gif) no-repeat right bottom">
         <% 
   Data data=new Data(dbuser,dbpass,dburl);
   //分页段 
     //变量声明 
   
String mysql=new String(); //SQL语句
mysql=" web_info where classid in("+cidstr+")";
int intRowCount=0;  //总的记录数
int intPageCount=0; //总的页数
int intPageSize=15; //每页显示的记录数
int intPage; //待显示页码 
String strPage=new String(); //用来接收当页码参数
int begin_no=0; //开始的rownum记录号
int end_no=0;  //结束的rownum记录号

//取得待显示页码 
strPage = request.getParameter("pages"); 
if(strPage==null){//表明在QueryString中没有page这一个参数，此时显示第一页数据 
intPage = 1; 
} 
else{//将字符串转换成整型 
intPage = java.lang.Integer.parseInt(strPage); 
if(intPage<1) intPage = 1; 
} 
//得到总的数据记录行数
intRowCount=data.getRowCount(mysql); //总记录数

//计算总共要分多少页
intPageCount = (intRowCount+intPageSize-1) / intPageSize; 
//调整待显示的页码 

if(intPage>intPageCount) intPage = intPageCount; 
//分页段
         begin_no=(intPage-1) * intPageSize + 1; 
        end_no = intPage * intPageSize;
		  ResultSet rsc=null;
		if(cidstr!=null&&!cidstr.equals(""))
		{
	    mysql="select * from (select rownum row_id ,iid,title,info,addtime,classid from (select  iid,title,info,addtime,classid from web_info where classid in("+cidstr+") order by iid desc))";
	    mysql=mysql+" where row_id between " +begin_no+ " and " +end_no;
	
	  // out.print(mysql);out.close();
	     rsc=con.getRs(mysql);
			}
		int i=0;
try{
        String otm="";
		while(rsc.next()){
		i++;
		otm=rsc.getString("info");
		//String title=rsc.getString("title");
         %>
	      <tr>
             <td class="infolist" width="100" style=" padding:0px;" >
			  <%if(rsc.getInt("iid")!=299){ %>
			 <%=rsc.getDate("addtime") %> 
			 <%}%>            
             </td>
			 <td width=800 class="infolist" style=" width:800px;" align=left>
			 <%if(rsc.getInt("iid")!=299){ %>
             <a href="display.jsp?m=<%=menu %>&iid=<%=rsc.getString("iid")%>&cid=<%=cid%>&left=<%=leftid%>" target="_blank" style="color:#C9000A;"><%=rsc.getString("title") %></a>
			 <%}%>
			 </span>          
             </td>
           </tr>
		   
            <% if(!("null".equals(otm) || "".equals(otm) || otm==null)){%>
            <tr>
             <td class="infolist" >  </td>
           <td class="infolist" align=left> 
		   <%//rs 20110710 add
			if(otm!=null)
			{
			   otm=otm.substring(0,60)+"........";
			}%>
		   <%=otm %></td>
           </tr>
           <tr>
             <td colspan="2" align="center" height=1 bgcolor=#cccccc>  </td>
           </tr>
            <%  }%>
			
      <%} %>
           <%if(intPageCount>1){ %>
            <tr>
             <td colspan="2" align="center"> <div class="pagelist"><%
             String pagehtml=con.getPage(intPage,intRowCount,intPageCount,"?cid="+cid+"&m="+menu+"&left="+leftid);
             out.print(pagehtml); 
 %>         </div></td>
           </tr>
           <%} %>
     </table>
    </div >
<% rsc.close();
}catch(Exception e){ }
%>
